Writeswell Jr. is a simple text editor that demonstrates the use of the Word Services Apple Event Suite for spell checking, grammar checking, or other text services. You can use a Word Services-aware spellchecker such as Spellswell 7 from Working Software to check text in Writeswell Jr. documents via System 7's Apple Events.
(System 7 is required to use Word Services, but Writeswell Jr. also works on System 6)
Please Register Writeswell Jr.!
Working Software, Inc. will notify you of updates to Writeswell Jr. if you register it with us. We will make it worth your while!
Please send us your name, address, phone number, and electronic mail address (if any). Send it to us via postal mail or e-mail. Also be sure to tell us what version of Writeswell Jr. you have.
Working Software Inc.
PO Box 1844
Santa Cruz, CA 95061-1844
AppleLink: D0140
Compuserve: 76004,2072 or GO MACBVEN
America Online: WORKINGSW
Internet: 76004,2072@compuserve.com
The source code to Writeswell Jr. is included, and may be used free of charge so that programmers may support Word Services in their own applications.
Double-click a Word Services service such as Spellswell 7. Then launch Writeswell Jr, and type some text in its window. Select "Get Batch Service" from Writeswell Jr.'s Services menu. Select the speller in the browser. This adds in item such as "Check Spelling" to the Services Menu. You can use this menu item to check spelling. After this initial setup the menu item will launch the speller whether it is running in the background or not, making it invisible that the speller is not a built-in menu item.
Position the speller's window so you can see the text in Writeswell Jr., and hit skip or replace as you like.
The technique that I use for handling Apple Events is the "Object First Approach" described by Richard Clark in the May, 1992 issue of d e v e l o p, in the article "Apple Event Objects and You."
I call this an "inverted" handling method myself in the code. I resolve the object specifier first (in a wildcard handler), and then pass the token to a dispatcher that calls the functions to actually do the event. The "normal" way to do it is to install a handler for each event, resolve the object specifier, and then call code to do the event for each type. The object first approach allows new data types to be added in a simpler manner.
I highly recommend reading Richard's article while studying this code.
The Object Support Library on this disk is converted from the MPW OSL using the ThinkC "oConv" utility. If you want to do the conversion yourself, use the vocabulary file in the OSL Libraries folder. If you convert without using the vocabulary file, the OSL function names will all be uppercase.
This source code is copyrighted. Permission is granted to use the Word Services portion of the Writeswell Jr. source code in your own programs, but you may not distribute the Writeswell Jr. word-processor code as a commercial product. If you modify the code, please do not call it Writeswell Jr. (or Writeswell.) This will ensure that people understand the program and don’t have to deal with a number of different versions with who-knows-what going on in the code.
Writeswell Jr.™ and Writeswell™ are trademarks of Working Software, Inc.